Skip to content

Conversation

@Michael-Jetson
Copy link

Find some bug when I try to train in my pc,and I fix it by codex-5.2,env info is:

  • cuda 12.8

  • isaacsim 5.1.0

  • RTX 5080

  • Ubuntu 24.03

  • python 3.11

  • torch 2.7.0
    Root cause: some Isaac Lab builds no longer expose Articulation.has_external_wrench, so _clear_forces hit AttributeError. After a quick workaround, the force-
    clearing path passed a wrongly shaped tensor (e.g., [1, 3]), causing set_forces_and_torques_at_position to fail because it expects 2D/3D force arrays.

    Changes in mimickit/engines/isaac_lab_engine.py:

    • set_body_forces now marks objects that received external forces so we only clear when needed.
    • _build_sim_tensors initializes self._has_body_forces for per-object tracking.
    • _clear_forces now checks obj.has_external_wrench or obj.data.has_external_wrench when available, otherwise falls back to the tracking flag. It clears forces
      with correct shapes based on object type: articulated uses [num_envs, num_bodies, 3], rigid uses [num_envs, 3], then resets the flag.

    This prevents API-compat crashes and ensures force clearing uses valid tensor dimensions.

@xbpeng
Copy link
Owner

xbpeng commented Jan 28, 2026

which version of IsaacLab are you using? MimicKit has been tested with 2ed331acfcbb1b96c47b190564476511836c3754. We will upgrade to the newer version of IsaacLab once they release the next stable version. But for now, we probably won't be upgrading to their latest changes until things have stabilized a bit more.

positions=None, env_ids=None,
body_ids=None, is_global=True)
num_envs = self.get_num_envs()
for obj_id, obj in enumerate(self._objs):
Copy link

@ustcscgyer ustcscgyer Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a much easier fix would be just to change this line to

if(getattr(obj, 'has_external_wrentch', False)):

then you don't need any other changes.

Articulation still has has_external_wrentch but unfortunately it was only set after you call set_external_force_and_torque.

https://github.com/isaac-sim/IsaacLab/blob/8ccebfe7cf04e3117ed05e78a85178d8d175b4c5/source/isaaclab/isaaclab/assets/articulation/articulation.py#L1013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this change with latest Isaaclab from uv pip install isaaclab and it works.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ustcscgyer thanks for the suggested change! That looks good to me, simple and elegant. Lets go with this fix instead. Would you like to submit a separate PR with your fix?

@Michael-Jetson does this fix the issues you were encountering on your side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants